package com.catietie.bookmanagement.controller;

import com.catietie.bookmanagement.common.result.Result;
import com.catietie.bookmanagement.dto.req.UserLoginReqDTO;
import com.catietie.bookmanagement.dto.resp.UserLoginRespDTO;
import com.catietie.bookmanagement.service.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Results;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@Slf4j
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;


    @GetMapping("/user/login")
    public Result<UserLoginRespDTO> login(@RequestBody UserLoginReqDTO userLoginReqDTO) {
        return Result.success(userService.login(userLoginReqDTO));
    }
}
